import request from '@/utils/request'
import {getToken} from "@/utils/auth";

export function login(data) {
  return request({
    url: '/gv-kube/user/get/token',
    // url: '/user/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: `/gv-kube/user/get/role?token=${token}`,
    // url: '/vue-element-admin/user/info',
    method: 'post'
    // params: { token }
  })
}

export function logout(token) {
  return request({
    url: `/gv-kube/user/logout?token=${token}`,
    method: 'post'
  })
}

export function getMenu() {
  return request({
    url: '/gv-kube/role/get/menu',
    method: 'post'
  })
}

export function getUserRole() {
  return request({
    url: `/gv-kube/user/get/role?token=${getToken()}`,
    method: 'post'
  })
}
